import {AxiosGetToParams, AxiosPostToFile, AxiosPutToJson, AxiosPutToParams} from "./AxiosEncapsulation.js"

//用户退出
async function TheUserLogsOut(jsonData) {
    const response = await AxiosGetToParams('/api/user/withdrawalUser', jsonData);
    return await response;
}

//更新密码
async function UpdatePassword(jsonData) {
    const response = await AxiosPutToJson('/api/user/modifyPassword', jsonData);
    return await response;
}

//更新用户名称
async function UpdateUserName(jsonData) {
    const response = await AxiosPutToJson('/api/user/modifyName', jsonData);
    return await response;
}

//更新用户邮箱
async function UpdateUserEmail(jsonData) {
    const response = await AxiosPutToJson('/api/user/modifyEmail', jsonData);
    return await response;
}

//更新用户简介
async function UpdateUserBriefIntroduction(jsonData) {
    const response = await AxiosPutToParams('/api/user/modifyUserIntroduction', jsonData);
    return await response;
}

//更新用户头像
async function UpdateUserAvatar(jsonData) {
    const response = await AxiosPutToParams('/api/user/modifyUserAvatar', jsonData);
    return await response;
}

//上传用户头像
async function uploadUserAvatar(fileData) {
    const response = await AxiosPostToFile('/api/user/uploadFile', fileData);
    return await response;
}


export {
    TheUserLogsOut,
    UpdatePassword,
    UpdateUserEmail,
    UpdateUserName,
    UpdateUserBriefIntroduction,
    uploadUserAvatar,
    UpdateUserAvatar
}